package org.example.text03;


import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

public class Main {
    public static void main(String[] args) {
//        //获取当前时间
//        LocalDate now = LocalDate.now();//年月日
//        LocalTime now1 = LocalTime.now();//时分秒
//        LocalDateTime now2 = LocalDateTime.now();//年月日时分秒
//
//        System.out.println(now.getMonthValue());//返回当前月
//        System.out.println(now1.getHour());//返回当前小时

        Magicer xfs = new Magicer("小法师",16,1,null);
        GreenStick stick = new GreenStick();
        xfs.setStick(stick);
        System.out.println(xfs.getName()+"伤害值:"+xfs.attack());
        xfs.practise();//练习
        xfs.practise();
        System.out.println(xfs.getName()+"练习后的伤害值:"+xfs.attack());

        Soldier soldier = new Soldier("yy",21,75,null);
        Bolo bolo = new Bolo();
        soldier.setWeapon(bolo);//战士有武器
        bolo.setSoldier(soldier);//武器有战士
        System.out.println("我是"+soldier.getName()+","+soldier.getAge()+"岁"+"，输出伤害："+soldier.attack());
        soldier.practise();
        System.out.println("我是"+soldier.getName()+","+soldier.getAge()+"岁"+"，练习后输出伤害："+soldier.attack());

        Soldier sol = new Soldier("zz",17,60,null);
        Pike pike = new Pike("霸王枪");
        //给zz添加武器
        sol.setWeapon(pike);
        //给武器设置使用者
        pike.setSoldier(sol);
        System.out.println("我是"+sol.getName()+","+sol.getAge()+"岁"+"，输出伤害为："+sol.attack());
        sol.practise();
        System.out.println("我是"+sol.getName()+","+sol.getAge()+"岁"+"，练习后的输出伤害为："+sol.attack());

    }
}